package ai.assist.common.vo.admin;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;

/**
 * PermissionRespNode
 *
 * @version V1.0
 */
@Data
public class PermissionRespNode {

    @ApiModelProperty(value = "id")
    private String id;

    @ApiModelProperty(value = "菜单权限名称")
    private String title;

    @ApiModelProperty(value = "")
    private String label;

    @ApiModelProperty(value = "icon")
    private String icon;

    @ApiModelProperty(value = "菜单权限标识", hidden = true)
    private String perms;

    @ApiModelProperty(value = "父级id")
    private String pid;

    @ApiModelProperty(value = "父级名称")
    private String pidName;

    @ApiModelProperty(value = "菜单权限类型(1:目录;2:菜单;3:按钮)")
    private Integer type;

    @ApiModelProperty("0内跳，1外跳")
    private Integer target;

    @ApiModelProperty("菜单权限名称")
    private String name;

    @ApiModelProperty("path")
    private String path;

    @ApiModelProperty("组件")
    private String component;

    @ApiModelProperty("隐藏")
    private Boolean hidden;

    private Meta meta;

    @ApiModelProperty("访问地址URL")
    private String redirect;

    @ApiModelProperty("排序")
    private Integer rank;

    @ApiModelProperty("下级")
    private List<PermissionRespNode> children;

    @Data
    public static class Meta {

        public Meta(String title, String icon) {
            this.title = title;
            this.icon = icon;
        }

        @ApiModelProperty(value = "菜单权限名称")
        private String title;

        @ApiModelProperty(value = "icon")
        private String icon;
    }

    public void setTitle(String title) {
        this.label = title;
        this.title = title;
    }
}
